#pragma once
#include "tgaimage.h"
#include "model.h"
#include <iostream>
using namespace std;
class Renderer
{
private:
	TGAImage m_img;
	int m_width;
	int m_height;
	float m_intensity;
public:
	Renderer(int w, int h);
	void DrawLine(int x0, int y0, int x1, int y1, TGAColor color);
	void DrawLine(int x0, int y0, float z0, int x1, int y1, float z1, float * zbuffer, TGAColor color);
	void DrawLineWithUV(float x0, float y0, float z0, Vec2f uv_start, float x1, float y1, float z1, Vec2f uv_end, float * zbuffer, TGAImage * imgae);
	void DrawMeshLine(Model* model, TGAColor color);
	void DrawMeshFace(Model * model, TGAColor color, Vec3f light_dir, float * zbuffer);
	void DrawMeshFaceWithUV(Model * model, TGAImage * imgae, Vec3f light_dir, float * zbuffer);
	void DrawTriangleWithUV(Vec3f * pts, Vec2f * uvs, float * zbuffer, TGAImage * image);
	void DrawTriangle(Vec3f * pts, float * zbuffer, TGAColor color);
	void OutPut();
	bool IsInTriangle(Vec2i* pts, Vec2i p);
};

